package com.qiche.service.impl;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.qiche.aspect.Result;
import com.qiche.mapper.MerchantMapper;
import com.qiche.model.Merchant;
import com.qiche.service.WxAccreditService;

import tk.mybatis.mapper.entity.Example;

/**
 * @author LB
 *
 * @date 2018年5月29日
 */
@Service("wxAccreditService")
public class WxAccreditServiceImpl implements WxAccreditService{
	
	private static final Logger log = LoggerFactory.getLogger(WxAccreditServiceImpl.class);

	@Autowired
	public MerchantMapper merchantMapper;
	
	@Override
	public Result<?> WxAccredit(String officialAccount) {
		Example example = new Example(Merchant.class);
		Example.Criteria criteria = example.createCriteria();
		criteria.andEqualTo("officialAccount", officialAccount);
		Merchant merchant= merchantMapper.selectOneByExample(example);
		if(merchant==null){
			return Result.createByErrorMessage("用户未填公众号");
		}
		
		return null;
	}

}
